<include file="public@header"/>
<style type="text/css">
    .pic-list li {
        margin-bottom: 5px;
    }
</style>
</head>
<link href="__STATIC__/vedio/video-js.css" rel="stylesheet">
<script src="__STATIC__/vedio/videojs-ie8.min.js"></script>
<script src="__STATIC__/vedio/video.js"></script>
<body>
<div class="wrap js-check-wrap">
    <!-- <ul class="nav nav-tabs">
        <li><a href="{:url('AdminStraming/stramingList')}">培训列表</a></li>
        <li class="active"><a>{$data['vm_title']}</a></li>
    </ul> -->
    <form action="{:url('AdminArticle/addPost')}" method="post" class="form-horizontal js-ajax-form margin-top-20">
        <div class="row">
            <div class="col-md-9">
                <table class="table table-bordered">
                    <tr>
                        <th width="120">发起者</th>
                        <td>
                            <input style="border:none;" class="form-control" value="{$data['staff_name']}--{$data['staff_number']}" readonly/>
                        </td>
                    </tr>
                    <tr>
                        <th>主题</th>
                        <td>
                            <input style="border:none;" class="form-control" value="{$data['vm_title']}" readonly/>
                        </td>
                    </tr>
                    <tr>
                        <th>培训分类</th>
                        <td>
                            <input style="border:none;" class="form-control" value="{$data['name']}" readonly/>
                        </td>
                    </tr>
                    <tr>
                        <th>开始时间</th>
                        <td>
                            <input style="border:none;" class="form-control" value="{$data['start_time']}" readonly/>
                        </td>
                    </tr>
                    <tr>
                        <th>培训时长</th>
                        <td>
                            <input style="border:none;" class="form-control" value="{$data['duration']} 分钟" readonly/>
                        </td>
                    </tr>
                    <tr>
                        <th>培训状态</th>
                        <td>
                            <input style="border:none;" class="form-control" value="{$stramingStatus[$data['status']]}" readonly/>
                        </td>
                    </tr>
                    <tr>
                        <th>培训简介</th>
                        <td>
                            <textarea style="border:none;" class="form-control" style="height: 50px;" readonly>{$data['intro']}</textarea>
                        </td>
                    </tr>
                    <tr>
                        <th>平台信息</th>
                        <td>
                            <table class="table table-bordered">
                                <thead>
                                <tr>
                                    <th>播放量</th>
                                    <th>平均分</th>
                                    <th>分享数</th>
                                    <th>是否公开</th>
                                    <th>标签</th>
                                </tr>
                                </thead>
                                <tbody>
                                <tr>
                                    <td>{$data.player_amount}</td>
                                    <td>{$data.score_mean}</td>
                                    <td>{$data.share_amount}</td>
                                    <td><if condition="$data['is_open'] eq 1">公开<else />不公开</if></td>
                                    <td>{$stramingLabel[$data['labels']]}</td>
                                </tr>
                                </tbody>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <th>发起时间</th>
                        <td>
                            <input style="border:none;" class="form-control" value="{$data['create_time']}" readonly/>
                        </td>
                    </tr>
                    <notempty name="data.update_time">
                        <tr>
                            <th>更新时间</th>
                            <td>
                                <input style="border:none;" class="form-control" value="{$data['update_time']}" readonly/>
                            </td>
                        </tr>
                    </notempty>
                    <notempty name="data.detele_time">
                        <tr>
                            <th>删除时间</th>
                            <td>
                                <input style="border:none;" class="form-control" value="{$data['detele_time']}" readonly/>
                            </td>
                        </tr>
                    </notempty>
                    <tr>
                        <th>必须参加人员</th>
                        <td>
                            <if condition="$data['control'] == 1">
                                <input style="border:none;" class="form-control" value="无限制" readonly/>
                            <else />
                            <table class="table table-bordered">
                                <thead>
                                <tr>
                                    <th>工号</th>
                                    <th>姓名</th>
                                    <th>部门</th>
                                    <th>职务</th>
                                </tr>
                                </thead>
                                <tbody>
                                <foreach name="data['confereeList']" item="vo">
                                    <tr>
                                        <td>{$vo.staff_number}</td>
                                        <td>{$vo.staff_name}</td>
                                        <td>{$vo.staff_deptname}</td>
                                        <td>{$vo.staff_duty}</td>
                                    </tr>
                                </foreach> 
                                </tbody>
                            </table>
                            </if>
                        </td>
                    </tr>
                    <tr>
                        <th>限制人员</th>
                        <td>
                            <if condition="$data['control'] == 1">
                                <input style="border:none;" class="form-control" value="无限制" readonly/>
                            <else />
                            <table class="table table-bordered">
                                <thead>
                                <tr>
                                    <th>工号</th>
                                    <th>姓名</th>
                                    <th>部门</th>
                                    <th>职务</th>
                                    <th>限制规则</th>
                                </tr>
                                </thead>
                                <tbody>
                                <foreach name="data['controlList']" item="vo">
                                    <tr>
                                        <td>{$vo.staff_number}</td>
                                        <td>{$vo.staff_name}</td>
                                        <td>{$vo.staff_deptname}</td>
                                        <td>{$vo.staff_duty}</td>
                                        <td>
                                            <if condition="$vo['rule'] == 1"> 可以看
                                            <else />  不可以看
                                            </if>
                                        </td>
                                    </tr>
                                </foreach> 
                                </tbody>
                            </table>
                            </if>
                        </td>
                    </tr>
                    <tr>
                        <th>互动内容</th>
                        <td>
                            <table class="table table-bordered">
                                <thead>
                                <tr>
                                    <th width="20%">工号</th>
                                    <th>内容</th>
                                    <th width="20%">时间</th>
                                </tr>
                                </thead>
                                <tbody>
                                <foreach name="data['confereeList']" item="vo">
                                    <tr>
                                        <td>{$vo.staff_number}</td>
                                        <td>{$vo.staff_name}</td>
                                        <td>{$vo.staff_deptname}</td>
                                    </tr>
                                </foreach> 
                                </tbody>
                            </table>
                        </td>
                    </tr>
                </table>
            </div>
            <div class="col-md-3">
                <table class="table table-bordered">
                    <tr>
                        <th><b>封面图片</b></th>
                    </tr>
                    <tr>
                        <td>
                            <a href="javascript:parent.imagePreviewDialog('{$data['cover_pic']}');">
                            <img width="100%" src="{$data['cover_pic']}"/>
                        </td>
                    </tr>
                </table>
                <notempty name="data.store_link">
                <table class="table table-bordered" width="500" heigth="200">
                    <tr>
                        <th><b>培训回放</b></th>
                    </tr>
                    <tr>
                        <td height="200px">
                            <video style="width:100%;height:100%" id="example_video_1" class="video-js vjs-default-skin" controls preload="none" poster="{$data['cover_pic']}" data-setup="{}" loop="loop" controls="controls">
                                <source src="{$data['store_link']}" type="video/mp4">
                                <source src="{$data['store_link']}" type="video/webm">
                                <source src="{$data['store_link']}" type="video/ogg">
                                <track kind="captions" src="../shared/example-captions.vtt" srclang="en" label="English"></track>
                                <!-- Tracks need an ending tag thanks to IE9 -->
                                <track kind="subtitles" src="../shared/example-captions.vtt" srclang="en" label="English"></track>
                                <!-- Tracks need an ending tag thanks to IE9 -->
                                <p class="vjs-no-js">To view this video please enable JavaScript, and consider upgrading to a web browser that</p>
                            </video>
                        </td>
                    </tr>
                </table>
                </notempty>
                <notempty name="data.challenge_id">
                <foreach name="stramingLabel" item="label">
                    <notempty name="label">
                        <a class="btn btn-primary" onclick="stramingLabel({$data['id']}, {$key})">设置为：{$label}</a><br/><br/> 
                    </notempty>
                </foreach>
                </notempty>
                 <!-- <a class="btn btn-default" href="{:url('AdminStraming/stramingList')}">{:lang('BACK')}</a> -->
            </div>
        </div>
    </form>
</div>
<script type="text/javascript" src="__STATIC__/js/admin.js"></script>
<script type="text/javascript">
    // 描述框高度自适应
    $('textarea').each(function () {
      this.setAttribute('style', 'height:' + (this.scrollHeight) + 'px;overflow-y:hidden;');
    }).on('input', function () {
      this.style.height = 'auto';
      this.style.height = (this.scrollHeight) + 'px';
    });

    // 设置标签
    function stramingLabel(vm_id, labels){
        $.ajax({
            url: "{:url('AdminStraming/stramingLabel')}",
            dataType: 'json',
            data: {'id':vm_id, 'msg':labels},
            type: "POST",
            success: function(data){
                if (data.code == '1') {
                    noty({
                        text: data.msg,
                        type: 'success',
                        layout: 'topCenter',
                        modal: true,
                        timeout: 800,
                        callback: {
                            afterClose: function () {
                                if (data.url) {
                                    //返回带跳转地址
                                    window.location.href = data.url;
                                } else {
                                    //刷新当前页
                                    reloadPage(window);
                                }
                            }
                        }
                    }).show();
                } else if (data.code == '0') {
                    art.dialog({
                        content: data.msg,
                        icon: 'warning',
                        ok: function () {
                            this.title(data.msg);
                            return true;
                        }
                    });
                }
            }
        });
    }
</script>
</body>
</html>
